## API Report File for "@backstage/plugin-bitbucket-cloud-common"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { BitbucketCloudIntegrationConfig } from '@backstage/integration';

// @public (undocumented)
export class BitbucketCloudClient {
  // (undocumented)
  static fromConfig(
    config: BitbucketCloudIntegrationConfig,
  ): BitbucketCloudClient;
  // (undocumented)
  listRepositoriesByWorkspace(
    workspace: string,
    options?: FilterAndSortOptions & PartialResponseOptions,
  ): WithPagination<Models.PaginatedRepositories, Models.Repository>;
  // (undocumented)
  searchCode(
    workspace: string,
    query: string,
    options?: FilterAndSortOptions & PartialResponseOptions,
  ): WithPagination<Models.SearchResultPage, Models.SearchCodeSearchResult>;
}

// @public (undocumented)
export namespace Events {
  // (undocumented)
  export interface Change {
    // (undocumented)
    closed: boolean;
    // (undocumented)
    commits: Models.Commit[];
    // (undocumented)
    created: boolean;
    // (undocumented)
    forced: boolean;
    // (undocumented)
    links: ChangeLinks;
    // (undocumented)
    new: Models.Branch;
    // (undocumented)
    old: Models.Branch;
    // (undocumented)
    truncated: boolean;
  }
  // (undocumented)
  export interface ChangeLinks {
    // (undocumented)
    commits: Models.Link;
    // (undocumented)
    diff: Models.Link;
    // (undocumented)
    html: Models.Link;
  }
  // (undocumented)
  export interface RepoEvent {
    // (undocumented)
    actor: Models.Account;
    // (undocumented)
    repository: Models.Repository & {
      workspace: Models.Workspace;
    };
  }
  // (undocumented)
  export interface RepoPush {
    // (undocumented)
    changes: Change[];
  }
  // (undocumented)
  export interface RepoPushEvent extends RepoEvent {
    // (undocumented)
    push: RepoPush;
  }
}

// @public (undocumented)
export type FilterAndSortOptions = {
  q?: string;
  sort?: string;
};

// @public (undocumented)
export namespace Models {
  export interface Account extends ModelObject {
    // (undocumented)
    created_on?: string;
    // (undocumented)
    display_name?: string;
    // (undocumented)
    links?: AccountLinks;
    // (undocumented)
    username?: string;
    // (undocumented)
    uuid?: string;
  }
  export interface AccountLinks {
    // (undocumented)
    [key: string]: unknown;
    // (undocumented)
    avatar?: Link;
  }
  export interface Author extends ModelObject {
    raw?: string;
    // (undocumented)
    user?: Account;
  }
  export interface BaseCommit extends ModelObject {
    // (undocumented)
    author?: Author;
    // (undocumented)
    date?: string;
    // (undocumented)
    hash?: string;
    // (undocumented)
    message?: string;
    // (undocumented)
    parents?: Array<BaseCommit>;
    // (undocumented)
    summary?: BaseCommitSummary;
  }
  // (undocumented)
  export interface BaseCommitSummary {
    html?: string;
    markup?: BaseCommitSummaryMarkupEnum;
    raw?: string;
  }
  const BaseCommitSummaryMarkupEnum: {
    readonly Markdown: 'markdown';
    readonly Creole: 'creole';
    readonly Plaintext: 'plaintext';
  };
  export type BaseCommitSummaryMarkupEnum =
    (typeof BaseCommitSummaryMarkupEnum)[keyof typeof BaseCommitSummaryMarkupEnum];
  export interface Branch {
    default_merge_strategy?: string;
    // (undocumented)
    links?: RefLinks;
    merge_strategies?: Array<BranchMergeStrategiesEnum>;
    name?: string;
    // (undocumented)
    target?: Commit;
    // (undocumented)
    type: string;
  }
  const BranchMergeStrategiesEnum: {
    readonly MergeCommit: 'merge_commit';
    readonly Squash: 'squash';
    readonly FastForward: 'fast_forward';
  };
  export type BranchMergeStrategiesEnum =
    (typeof BranchMergeStrategiesEnum)[keyof typeof BranchMergeStrategiesEnum];
  export interface Commit extends BaseCommit {
    // (undocumented)
    participants?: Array<Participant>;
    // (undocumented)
    repository?: Repository;
  }
  export interface CommitFile {
    // (undocumented)
    [key: string]: unknown;
    // (undocumented)
    attributes?: CommitFileAttributesEnum;
    // (undocumented)
    commit?: Commit;
    escaped_path?: string;
    path?: string;
    // (undocumented)
    type: string;
  }
  const // (undocumented)
    CommitFileAttributesEnum: {
      readonly Link: 'link';
      readonly Executable: 'executable';
      readonly Subrepository: 'subrepository';
      readonly Binary: 'binary';
      readonly Lfs: 'lfs';
    };
  // (undocumented)
  export type CommitFileAttributesEnum =
    (typeof CommitFileAttributesEnum)[keyof typeof CommitFileAttributesEnum];
  export interface Link {
    // (undocumented)
    href?: string;
    // (undocumented)
    name?: string;
  }
  export interface ModelObject {
    // (undocumented)
    [key: string]: unknown;
    // (undocumented)
    type: string;
  }
  export interface Paginated<TResultItem> {
    next?: string;
    page?: number;
    pagelen?: number;
    previous?: string;
    size?: number;
    values?: Array<TResultItem> | Set<TResultItem>;
  }
  export interface PaginatedRepositories extends Paginated<Repository> {
    values?: Set<Repository>;
  }
  export interface Participant extends ModelObject {
    // (undocumented)
    approved?: boolean;
    participated_on?: string;
    // (undocumented)
    role?: ParticipantRoleEnum;
    // (undocumented)
    state?: ParticipantStateEnum;
    // (undocumented)
    user?: Account;
  }
  const // (undocumented)
    ParticipantRoleEnum: {
      readonly Participant: 'PARTICIPANT';
      readonly Reviewer: 'REVIEWER';
    };
  // (undocumented)
  export type ParticipantRoleEnum =
    (typeof ParticipantRoleEnum)[keyof typeof ParticipantRoleEnum];
  const // (undocumented)
    ParticipantStateEnum: {
      readonly Approved: 'approved';
      readonly ChangesRequested: 'changes_requested';
      readonly Null: 'null';
    };
  // (undocumented)
  export type ParticipantStateEnum =
    (typeof ParticipantStateEnum)[keyof typeof ParticipantStateEnum];
  export interface Project extends ModelObject {
    // (undocumented)
    created_on?: string;
    // (undocumented)
    description?: string;
    has_publicly_visible_repos?: boolean;
    is_private?: boolean;
    key?: string;
    // (undocumented)
    links?: ProjectLinks;
    name?: string;
    // (undocumented)
    owner?: Team;
    // (undocumented)
    updated_on?: string;
    uuid?: string;
  }
  // (undocumented)
  export interface ProjectLinks {
    // (undocumented)
    avatar?: Link;
    // (undocumented)
    html?: Link;
  }
  // (undocumented)
  export interface RefLinks {
    // (undocumented)
    commits?: Link;
    // (undocumented)
    html?: Link;
    // (undocumented)
    self?: Link;
  }
  export interface Repository extends ModelObject {
    // (undocumented)
    created_on?: string;
    // (undocumented)
    description?: string;
    fork_policy?: RepositoryForkPolicyEnum;
    full_name?: string;
    has_issues?: boolean;
    has_wiki?: boolean;
    // (undocumented)
    is_private?: boolean;
    // (undocumented)
    language?: string;
    // (undocumented)
    links?: RepositoryLinks;
    // (undocumented)
    mainbranch?: Branch;
    // (undocumented)
    name?: string;
    // (undocumented)
    owner?: Account;
    // (undocumented)
    parent?: Repository;
    // (undocumented)
    project?: Project;
    // (undocumented)
    scm?: RepositoryScmEnum;
    // (undocumented)
    size?: number;
    slug?: string;
    // (undocumented)
    updated_on?: string;
    uuid?: string;
  }
  const RepositoryForkPolicyEnum: {
    readonly AllowForks: 'allow_forks';
    readonly NoPublicForks: 'no_public_forks';
    readonly NoForks: 'no_forks';
  };
  export type RepositoryForkPolicyEnum =
    (typeof RepositoryForkPolicyEnum)[keyof typeof RepositoryForkPolicyEnum];
  const // (undocumented)
    RepositoryScmEnum: {
      readonly Git: 'git';
    };
  // (undocumented)
  export interface RepositoryLinks {
    // (undocumented)
    avatar?: Link;
    // (undocumented)
    clone?: Array<Link>;
    // (undocumented)
    commits?: Link;
    // (undocumented)
    downloads?: Link;
    // (undocumented)
    forks?: Link;
    // (undocumented)
    hooks?: Link;
    // (undocumented)
    html?: Link;
    // (undocumented)
    pullrequests?: Link;
    // (undocumented)
    self?: Link;
    // (undocumented)
    watchers?: Link;
  }
  // (undocumented)
  export type RepositoryScmEnum =
    (typeof RepositoryScmEnum)[keyof typeof RepositoryScmEnum];
  // (undocumented)
  export interface SearchCodeSearchResult {
    // (undocumented)
    readonly content_match_count?: number;
    // (undocumented)
    readonly content_matches?: Array<SearchContentMatch>;
    // (undocumented)
    file?: CommitFile;
    // (undocumented)
    readonly path_matches?: Array<SearchSegment>;
    // (undocumented)
    readonly type?: string;
  }
  // (undocumented)
  export interface SearchContentMatch {
    // (undocumented)
    readonly lines?: Array<SearchLine>;
  }
  // (undocumented)
  export interface SearchLine {
    // (undocumented)
    readonly line?: number;
    // (undocumented)
    readonly segments?: Array<SearchSegment>;
  }
  // (undocumented)
  export interface SearchResultPage extends Paginated<SearchCodeSearchResult> {
    // (undocumented)
    readonly query_substituted?: boolean;
    readonly values?: Array<SearchCodeSearchResult>;
  }
  // (undocumented)
  export interface SearchSegment {
    // (undocumented)
    readonly match?: boolean;
    // (undocumented)
    readonly text?: string;
  }
  export interface Team extends Account {
    // (undocumented)
    links?: TeamLinks;
  }
  export interface TeamLinks extends AccountLinks {
    // (undocumented)
    html?: Link;
    // (undocumented)
    members?: Link;
    // (undocumented)
    projects?: Link;
    // (undocumented)
    repositories?: Link;
    // (undocumented)
    self?: Link;
  }
  export interface Workspace extends ModelObject {
    // (undocumented)
    created_on?: string;
    is_private?: boolean;
    // (undocumented)
    links?: WorkspaceLinks;
    name?: string;
    slug?: string;
    // (undocumented)
    updated_on?: string;
    uuid?: string;
  }
  // (undocumented)
  export interface WorkspaceLinks {
    // (undocumented)
    avatar?: Link;
    // (undocumented)
    html?: Link;
    // (undocumented)
    members?: Link;
    // (undocumented)
    owners?: Link;
    // (undocumented)
    projects?: Link;
    // (undocumented)
    repositories?: Link;
    // (undocumented)
    self?: Link;
    // (undocumented)
    snippets?: Link;
  }
}

// @public (undocumented)
export type PaginationOptions = {
  page?: number;
  pagelen?: number;
};

// @public (undocumented)
export type PartialResponseOptions = {
  fields?: string;
};

// @public (undocumented)
export type RequestOptions = FilterAndSortOptions &
  PaginationOptions &
  PartialResponseOptions & {
    [key: string]: string | number | undefined;
  };

// @public (undocumented)
export class WithPagination<
  TPage extends Models.Paginated<TResultItem>,
  TResultItem,
> {
  constructor(
    createUrl: (options: PaginationOptions) => URL,
    fetch: (url: URL) => Promise<TPage>,
  );
  // (undocumented)
  getPage(options?: PaginationOptions): Promise<TPage>;
  // (undocumented)
  iteratePages(options?: PaginationOptions): AsyncGenerator<TPage, void>;
  // (undocumented)
  iterateResults(
    options?: PaginationOptions,
  ): AsyncGenerator<Awaited<TResultItem>, void, unknown>;
}
```
